import req from '@/utils/axios.js';
import * as url from '@/constants/api.js'


export function getDepartment() {
    return req({
        url: url.GET_DEPARTMENT,
        method: 'GET',
    })
}
// 新增子部门
export function postDepartment(info, pid) {
    return req({
        url: url.GET_DEPARTMENT,
        method: 'POST',
        data: {
            name: info.name, //部门名称
            code: info.code, //部门编码
            manager: info.manager, //负责人
            introduce: info.introduce, //部门介绍
            pid,
        }
    })
}
//修改部门
export function putDepartment(data) {
    return req({
        url: url.PUT_DEPARTMENT + data.id,
        method: 'PUT',

        data,
    })
}


//删除部门
export function delDepartment(id) {
    return req({
        url: url.DELETE_DEPARTMENT + id,
        method: 'DELETE',
    })
}
//获取管理员
export function getsimple() {
    return req({
        url: url.GET_SIMPLE,
        method: 'GET',
    })
}